package com.example.demo.service.impl;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.alibaba.fastjson.JSONObject;
import com.example.demo.consumer.AddressProvider;
import com.example.demo.entity.AddressInBean;
import com.example.demo.entity.AddressOutBean;
import com.example.demo.service.UserService;

@Service
public class UserServiceImpl implements UserService{
	
	@Autowired
	private AddressProvider addressProvider;

	@Override
	public AddressOutBean getAddress(AddressInBean inBean) {
		return JSONObject.parseObject(addressProvider.invoke("getAddress", inBean),AddressOutBean.class);
	}

}
